<?php /* Smarty version Smarty-3.1.12, created on 2012-12-16 19:20:55
         compiled from "templates\default\chat.tpl" */ ?>
<?php /*%%SmartyHeaderCode:3267850ce1f1705a5d3-67767650%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'cae2d3de4828fbea3d0beeeca8a8b4728412abf9' => 
    array (
      0 => 'templates\\default\\chat.tpl',
      1 => 1140475408,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '3267850ce1f1705a5d3-67767650',
  'function' => 
  array (
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.12',
  'unifunc' => 'content_50ce1f17089e15_40649392',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_50ce1f17089e15_40649392')) {function content_50ce1f17089e15_40649392($_smarty_tpl) {?><?php if (!is_callable('smarty_function_ajax_call')) include 'C:\\wamp\\www\\BlogS\\libs\\plugins\\function.ajax_call.php';
if (!is_callable('smarty_function_ajax_update')) include 'C:\\wamp\\www\\BlogS\\libs\\plugins\\function.ajax_update.php';
?><h2>Simple AJAX chat example</h2>
<div style="overflow:auto;height: 200px;border: 1px solid #5b6a90" id="chat_log"></div>
Your message: <input id="message" size="80" class="edit">
<input type="button" value="Send" id="send" onclick="<?php echo smarty_function_ajax_call(array('method'=>"post",'function'=>"add_message",'params_func'=>"Chat.getParams",'callback'=>"Chat.onMessageSent"),$_smarty_tpl);?>
">
<script type="text/javascript">

var Chat = {
  initialize: function() {
    new PeriodicalExecuter(this.update, 1);
    Event.observe($("message"), "keypress", this.onKeyPress, false);
  },

  update: function() {

    <?php echo smarty_function_ajax_update(array('update_id'=>"chat_log",'function'=>"get_messages"),$_smarty_tpl);?>


  },

  getParams: function() {
    return { message: $F("message") }
  },

  onKeyPress: function(e) {
    if (e.keyCode == Event.KEY_RETURN) $("send").click();
  },

  onMessageSent: function() {
    Field.clear("message");
    Field.focus("message");
  }
}
Chat.initialize();

</script><?php }} ?>